The optical scanner used in an image forming apparatus for forming an electrostatic latent image on a photoconductive drum uses a Micro Electro Mechanical System (MEMS) mirror. The optical scanner drives the MEMS mirror so that a photoconductive drum is scanned by laser to form an electrostatic latent image. Sometimes, the drive position of the MEMS mirror is deviated for the change in temperature or the secular change of the MEMS mirror. Thus, the optical scanner needs to detect the drive position of the HEMS mirror. However, sometimes, to detect the drive position of the MEMS mirror, another optical sensor such as a light beam detection sensor must be provided for laser detection, thus increasing the size of the optical scanner.